- 
                Notifications
    
You must be signed in to change notification settings  - Fork 3.9k
 
GH-47659: [C++] Fix Arrow Flight Testing's unresolved external symbol error #47660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| 
           | 
    
| 
           Can we solve this by the following? diff --git a/cpp/src/arrow/flight/test_definitions.cc b/cpp/src/arrow/flight/test_definitions.cc
index c6b8e2b422..5979dd76eb 100644
--- a/cpp/src/arrow/flight/test_definitions.cc
+++ b/cpp/src/arrow/flight/test_definitions.cc
@@ -39,7 +39,6 @@
 #include "arrow/util/checked_cast.h"
 #include "arrow/util/config.h"
 #include "arrow/util/logging.h"
-#include "gmock/gmock.h"
 
 #if defined(ARROW_CUDA)
 #  include "arrow/gpu/cuda_api.h" | 
    
| 
           Hi @kou, I have tried out the solution and the errors came back after undoing the changes at  I then found there is also   | 
    
| 
           Ah, OK. arrow/cpp/src/arrow/flight/test_util.h Line 57 in 19e3f90 
 Could you use   | 
    
| 
           Isn't the gmock dependency already satisfied through the use of   | 
    
| 
           Ah, should we move arrow/cpp/src/arrow/flight/test_util.h Lines 46 to 58 in 19e3f90 
 test_util.cc and don't include gmock/gmock.h in our *.h?
       | 
    
| 
           Worth a shot!  | 
    
| 
           @kou I have moved  arrow/cpp/src/arrow/CMakeLists.txt Lines 952 to 953 in 13c2615 
 @WillAyd  I found  Thanks both for providing suggestions and info  | 
    
          
 To try and clarify, my concern was less about the library itself and more about tests that use the library. I couldn't find any definitive guidance about the different combinations of g{test|mock}_{main} and how their linkage affects the test runner on Windows. Its also easy to overlook when it causes an issue; the test suite still passes, so you'd have to manually inspect the logs to see if tests were actually being run The main Windows CI job I don't think has FLIGHT tests enabled, so its hard to tell from the CI runs here. When you try locally, are you sure that tests are actually collected and running? If so, then I'm OK with this - I certainly don't want to go down a rabbit hole chasing issues  | 
    
| 
           @WillAyd Got it, thanks for your clarification. On my branch, I have run  I am not very familiar with the combinations of gmock linkage either. Current Windows CI only run on  I think these tests have always been running on the Windows CI because I was able to catch Flight SQL ODBC test failures using CI before the fix of #47434.  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @alinaliBQ for checking that offline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Remove comment Use `SHARED_LINK_LIBS` for gmock dependency Attempt removing `gmock` Move `AssertEqual` definition to test_util.cc
42d8af3    to
    76db6f7      
    Compare
  
    | 
           After merging your PR, Conbench analyzed the 2 benchmarking runs that have been run so far on merge-commit bc9746d. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 1 possible false positive for unstable benchmarks that are known to sometimes produce them.  | 
    
…symbol error (apache#47660) ### Rationale for this change Fixes issue at apache#47659 ### What changes are included in this PR? Include add gmock as a shared private link library to `arrow_flight_testing` ### Are these changes tested? Build for `arrow_flight_testing` succeeds on my Windows environment ### Are there any user-facing changes? No * GitHub Issue: apache#47659 Authored-by: Alina (Xi) Li <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
Rationale for this change
Fixes issue at #47659
What changes are included in this PR?
Include add gmock as a shared private link library to
arrow_flight_testingAre these changes tested?
Build for
arrow_flight_testingsucceeds on my Windows environmentAre there any user-facing changes?
No